Completed
Push — master ( 7ac302...19db85 )
by SILENT
02:18
created

customizer.js ➔ api(ꞌblognameꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
/**
2
 * Theme Customizer enhancements for a better user experience.
3
 *
4
 * Contains handlers to make Theme Customizer preview reload changes asynchronously.
5
 */
6
7
( function( $ ) {
8
	// Site title and description.
9
	wp.customize( 'blogname', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
10
		value.bind( function( to ) {
11
			$( '.site-title' ).text( to );
12
		} );
13
	} );
14
	wp.customize( 'blogdescription', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
15
		value.bind( function( to ) {
16
			$( '.site-description' ).text( to );
17
		} );
18
	} );
19
	// Header text color.
20
	wp.customize( 'header_textcolor', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
21
		value.bind( function( to ) {
22
			if ( 'blank' === to ) {
23
				$( '.site-title, .site-description' ).css( {
24
					'clip': 'rect(1px, 1px, 1px, 1px)',
25
					'position': 'absolute'
26
				} );
27
			} else {
28
				$( '.site-title, .site-description' ).css( {
29
					'clip': 'auto',
30
					'position': 'static'
31
				} );
32
33
				$( '.site-title a, .site-description' ).css( {
34
					'color': to
35
				} );
36
				$( '.site-title a' ).css( {
37
					'border-color': to
38
				} );
39
			}
40
		} );
41
	} );
42
} )( jQuery );
43